package org.example.ch02.p22;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
        int hundred=num/100;
        int tens=num%100/10;
        int ones=num%10;
        int sum=hundred+tens+ones;
        System.out.println(sum);
        sc.close();
    }
}
